package com.shopping.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shopping.dao.StockDao;
import com.shopping.po.Stock;
import com.shopping.service.StockService;


@Service
@Transactional
public class StockServiceImpl implements StockService {
	@Autowired
	private StockDao stockDao;
	public List<Stock> findStockByAll(){
		return this.stockDao.findStockByAll();
	}
	
	public List<Stock> findGoodsByStatus(String status){
		return this.stockDao.findGoodsByStatus(status);
	}
	
	
	public void updateGoodsByStatus(Integer stock_id,String status) {
		stockDao.updateGoodsByStatus(stock_id,status);
	}
	
	public Stock findGoodsById(Integer stock_id) {
		return this.stockDao.findGoodsById(stock_id);
	}
	public void updateStock(Stock stock) {
		this.stockDao.updateStock(stock);
	}
	public void insertStock(Stock stock) {
		this.stockDao.insertStock(stock);
	}
	public void deleteStockById(Integer stock_id) {
		stockDao.deleteStockById(stock_id);
	}
	public Stock selectStockById(Integer stock_id) {
		return stockDao.selectStockById(stock_id);
	}
}
